(function () {
  'use strict';

  angular.module('BlurAdmin.theme.components')
    .directive('onFinishRender', function ($timeout) {
      return {
        restrict: 'A',
        link: function (scope, element, attr) {
          if (scope.$last === true) {
            $timeout(function () {
              scope.$emit(attr.onFinishRender);
            });
          }
        }
      }
    })
    .directive('agoraVideo', agoraVideo);

  /** @ngInject */
  function agoraVideo() {
    return {
      restrict: 'E',
      templateUrl: 'app/theme/components/agoraVideo/agoraVideo.html',
      controller: 'AgoraVideoCtrl'
    };
  }

})();